package com.itheima.test2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
使用文件字节输入流
文件字节输出流  复制文件
 */
public class Test01 {

    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("C:\\Users\\Administrator\\Desktop\\美女\\meinv2.jpg");
        FileOutputStream fos = new FileOutputStream("day12\\copy\\copy.jpg");

        //边读边写
        int  b;
        //int count=0;
        long start = System.currentTimeMillis();
        while ((b=fis.read())!=-1){
           fos.write(b);
          // count++;
        }

        long end = System.currentTimeMillis();
        System.out.println(end-start);//1790
        //System.out.println(count);
        fis.close();
        fos.close();

    }
}
